Preparing your computer

Make sure you have downloaded RStudio from the IMF software center.

Start RStudio.

Click on File, New Project. The following dialogue will pop up:

Click on New Directory. Pick create new project. Fill in like below.

You now get the following screen. Click on new folder (highlighted in yellow):

Create two folders: databases and figures

Copy the following files from \\was.int.imf.org\ecn\ems_shared\pub\R-tutorial into your overall IMF_R_Tutorial folder:

Your project directory should now look like this:

Once all of these contents have been copied to your folder, double-click on your Library Installer.R script, or navigate to it via the files tab directly in R studio.

This script automatically reads the list of required libraries from the library list text document and installs them. The script will also automatically install the internal bookr library we have created.

Run the script by typing this command in the R console and pressing enter.

source("Library Installer.R")

This process will take some time, but your console will display the following message when completed, “Setup complete.”

Here’s a brief overview of the project directory structure and what each folder is for:

You are now set to follow the code.